package com.cloud.alibaba.rpc.dubbo;

import com.cloud.alibaba.DubboApiService;
import com.cloud.alibaba.domain.Author;
import com.cloud.alibaba.service.ProducerService;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @author 刘志强
 * @date 2020/11/17 14:55
 */
@Service(version = "1.0.0")
public class DubboApiImpl implements DubboApiService {

    @Autowired
    private Author author;
    @Autowired
    private ProducerService producerService;

    @Override
    public String getUserName() {
        return author.toString();
    }

    @Override
    public Integer addUser(String userName) {
        return producerService.addUser(userName);
    }
}
